/**
 * 
 */
package site.dao;

import java.sql.Connection;
import java.sql.SQLException;

import neoutil.CommonDao;
import site.entity.Category;

/**
 * @author Neo
 * 
 */
public class CategoryDao extends CommonDao<Category, Long> {
	private String SQL_INSERT = "INSERT INTO category(uuid, cid, name, parentCid, level, type, entityStatus, entityDatetime) VALUES(?, ?, ?, ?, ?, ?, ?, ?)";

	public CategoryDao(Connection connection) {
		super(Category.class, connection);
	}

	public void save(Category category) throws SQLException {
		Object[] params = { category.getUuid(), category.getCid(),
				category.getName(), category.getParentCid(),
				category.getLevel(), category.getType(),
				category.getEntityStatus(), category.getEntityDatetime() };
		execute(SQL_INSERT, params);
	}
}
